const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const mongoosePaginate = require('mongoose-paginate');
const ObjectId = Schema.ObjectId;

// 定义一个普通的数据模型
var CommendSchema = new Schema({
    name:String,
    email:String,
    title:String,
    date:{type:Date,default: Date.now },
    text:String,
    newsId:ObjectId
});
// 将数据模型应用分页插件
CommendSchema.plugin(mongoosePaginate);

module.exports = mongoose.model('Commend', CommendSchema,'Commend');